#include<vector>
#include<algorithm>
using namespace std;

bool cmp(int i, int j){
    return i<j;
}

class Solution {
public:
    bool isStraight(vector<int>& nums) {
        sort(nums.begin(),nums.end());
        int zero_cnt = 0;
        int diff = 0;
        int n = nums.size();
        for (int i = 0; i < n; i++)
        {
            if(nums[i]==0){
                zero_cnt++;
            }else{
                if(i+1<n && nums[i]==nums[i+1]){
                    return false;
                }
                if (i+1<n && nums[i]+1!=nums[i+1])
                {
                    diff+= (nums[i+1]-nums[i]-1);
                }         
            }
        }
        return zero_cnt>=diff;
    }
};